use postgres::{Client, Error, NoTls};

fn main() -> Result<(), Error> {
    let mut client = Client::connect("postgresql://postgres@192.168.2.88/owl-eye", NoTls)?;

    // for i in 17..21 {
        let mut solar:Vec<&str> =Vec::new();

        solar.push("657169507118219217");
        solar.push("太阳能17能量32比特位");
        solar.push("Solar 17 energy Float 32 Bit");
        solar.push("Solar 17 energy Float 32 Bit");

        client.execute("INSERT INTO public.iot_param_template (id,\"name\",english_name,field,zh_unit,en_unit,virtual_sign,range_max,range_min,controllable,description,create_time,update_time,create_user,update_user,customer_id,data_type) VALUES 
($1,$2,$3,'bit_solar_energy','kW·h','kW·h',0,NULL,NULL,0,$4,now(),NULL,-1,NULL,1,2)
;", &[&solar[0],&solar[1],&solar[2],&solar[3]])?;
    // }

    Ok(())
}
